<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>logic数据导入导出</title>
<jsp:include page="../inc.jsp"></jsp:include>
<style scoped>
	.f1{
		width:200px;
	}
	.filebox .textbox-value {
  vertical-align: top;
  position: absolute;
  top: 0;
  left: -5000px;
}
.filebox-label {
  display: inline-block;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
  left: 0;
  top: 0;
  z-index: 10;
  background: url('../images/blank.gif') no-repeat;
}
</style>
<script type="text/javascript" charset="UTF-8">
	var productComboboxImport;
	var productComboboxExport;
	var versionComboboxImport;
	var versionComboboxExport;
	var versionname ;
	
	var productComboboxImportByScript;
	var versionComboboxImportByScript;
	
	//var url ='${pageContext.request.contextPath}/logicController/importLogic?versionname='+versionname;
	$(function() {
		/**
		var requestUrl;
		var defineURL = function(versionname){
			requestUrl = '${pageContext.request.contextPath}/logicController/importLogic?versionname='+versionname;
		}
		var getdefineURL = function(){
			return requestUrl;
		}
		*/
		
		// 导入logic的接口
		$('#import_logic_form').form({
			url : '${pageContext.request.contextPath}/logicController/importLogic',
			success : function(r) {
				var json = jQuery.parseJSON(r);
				$.messager.show({
					title : '提示',
					msg : json.msg
				});
			}
		});
		
		// 导入review的函数
		$('#import_scriptReview_form').form({
			url : '${pageContext.request.contextPath}/reviewController/importReviewTask',
			success : function(r) {
				var json = jQuery.parseJSON(r);
				$.messager.show({
					title : '提示',
					msg : json.msg
				});
			}
		});
		
		// 导入失败脚本excel的函数
		$('#import_scriptExcel_form').form({
			url : '${pageContext.request.contextPath}/scriptController/importScriptExcel',
			success : function(r) {
				var json = jQuery.parseJSON(r);
				$.messager.show({
					title : '提示',
					msg : json.msg
				});
			}
		});
		
		// 导出logic的接口
		$('#export_logic_form').form({
			url : '${pageContext.request.contextPath}/logicController/exportLogic',
			success : function(r) {
				var json = jQuery.parseJSON(r);
				$.messager.show({
					title : '提示',
					msg : json.msg
				});
			}
		});
		
		// logic 导入使用，根据产品关联查询出版本号
		productComboboxImport = $('#import_logic_form_product').combobox({
			url : '${pageContext.request.contextPath}/productController/productCombobox',
			valueField : 'name',
			textField : 'name',
			required : true,
			panelHeight : 'auto',
			mode : 'remote',
			delay : 500,
			onSelect: function(rec){
			    var url = '${pageContext.request.contextPath}/versionController/versionCombobox?productName='+rec.name;
			    $('#import_logic_form_version').combobox('reload', url);
		    }
		});
		
		
		versionComboboxImport = $('#import_logic_form_version').combobox({
			valueField:'name',
			textField:'name',
			required : true
		});
		
		// 失败用例导入使用
		productComboboxImportByScript = $('#import_scriptExcel_form_product').combobox({
			url : '${pageContext.request.contextPath}/productController/productCombobox',
			valueField : 'name',
			textField : 'name',
			required : true,
			panelHeight : 'auto',
			mode : 'remote',
			delay : 500,
			onSelect: function(rec){
			    var url = '${pageContext.request.contextPath}/versionController/versionCombobox?productName='+rec.name;
			    $('#import_scriptExcel_form_version').combobox('reload', url);
		    }
		});
		
		
		versionComboboxImportByScript = $('#import_scriptExcel_form_version').combobox({
			valueField:'name',
			textField:'name',
			required : true
		});
		
		
		
		// 导出使用，根据产品关联查询出版本号
		productComboboxExport = $('#export_logic_form_product').combobox({
			url : '${pageContext.request.contextPath}/productController/productCombobox',
			valueField : 'name',
			textField : 'name',
			required : true,
			panelHeight : 'auto',
			mode : 'remote',
			delay : 500,
			onSelect: function(rec){
			    var url = '${pageContext.request.contextPath}/versionController/versionCombobox?productName='+rec.name;
			    $('#export_logic_form_version').combobox('reload', url);
		    }
		});

		window.setTimeout(function() {
			parent.$.messager.progress('close');
		}, 0);

	});
	
	
</script>
<link rel="stylesheet" href="../css/logicIO.css">
</head>
<body>
	<div>
		<div id="export_excel_reg">
			<form id="export_logic_form" method="post">
			<table>
			<tr>
				<td>选择 产品 ： </td>
				<td><input id="export_logic_form_product" name="productname" ></td>
			</tr>
			<tr>
				<td>·</td>
				<td>·</td>
			</tr>
			<tr>
				<td>选择 版本 ：</td>
				<td><input id="export_logic_form_version"  name="versionname" class="easyui-combobox" data-options="
				valueField:'name',textField:'name',
				onSelect: function(rec){
					versionname = rec.name;
				}"></td>
			</tr>
			<tr>
				<td>·</td>
				<td>·</td>
			</tr>
			<tr>
				<td colspan="3"><p class="excel">导出修改过的logic.zip数据，没修改过的参考工厂logic不做导出</p></td>
				<td></td>
			</tr>
			</table>
			<input type="button" class="btn btn-primary" value="导出logic.zip" onclick="$('#export_logic_form').submit(); " />
			</form>
		</div>
		<div id="import_excel_reg">
			<form id="import_logic_form" method="post" enctype="multipart/form-data">
				<table>
					<tr>
					<td>选择 产品 ：  </td>
					<td><input id="import_logic_form_product"  name="productname"></td>
					</tr>
					<tr>
					<td>·</td>
					<td>·</td>
					</tr>
					<tr>
					<td>选择 版本 ： </td>
					<td><input id="import_logic_form_version"  name="versionname"></td>
					</tr>
					<tr>
					<td>·</td>
					<td>·</td>
					</tr>
				<!--  	<tr>
					<td colspan="3"><label for="regIO_file" class="excel">选择要导入的logic.rar文件:</label></td>
					</tr>  -->
				</table>
				 <br> <br> 
				<input type="file" name="file" class="btn btn-primary" id="regIO_file" size="8" /> <br> <br> 
				<input type="button" class="btn btn-primary" value="导入的logic.rar文件" onclick="$('#import_logic_form').submit(); " />
				
			</form>
		</div>
		<div id="clear"></div>
		<div id="import_excel_reg">
			<form id="import_scriptExcel_form" method="post" enctype="multipart/form-data">
			<table>
				<tr>
				<td>选择 产品 ：  </td>
				<td><input id="import_scriptExcel_form_product"  name="productname"></td>
				</tr>
				<tr>
				<td>·</td>
				<td>·</td>
				</tr>
				<tr>
				<td>选择 版本 ： </td>
				<td><input id="import_scriptExcel_form_version"  name="versionName"></td>
				</tr>
				<tr>
				<td>·</td>
				<td>·</td>
				</tr>
			</table>
			 <br> <br>
			<input type="file" name="file" class="btn btn-primary" id="import_scriptExcel_file" size="8" /> <br> <br> 
			<input type="button" class="btn btn-primary" value="导入失败脚本excel" onclick="$('#import_scriptExcel_form').submit(); " />
			</form>
		</div>
		<div id="import_excel_reg">
			<form id="import_scriptReview_form" method="post" enctype="multipart/form-data">
				 <br>
				<input type="file" name="file" class="btn btn-primary" id="import_scriptReview_file" size="8" /> <br> <br> 
				<input type="button" class="btn btn-primary" value="导入脚本review" onclick="$('#import_scriptReview_form').submit(); " />
			</form>
		</div>
		<div id="clear"></div>
	</div>
	<!--  
	<div>
		<div id="export_excel_user">
			<p class="excel">导出用户数据</p>
			<a id="btn_user" href="${pageContext.request.contextPath}/exportController/exportUserToExcela"
				class="easyui-linkbutton" data-options="iconCls:'icon-redo'">导出</a> &nbsp;&nbsp;&nbsp;&nbsp;
			<a id="btn1_user"
				href="${pageContext.request.contextPath}/exportController/exportUserModela" class="easyui-linkbutton"
				data-options="iconCls:'icon-redo'">导出填写项目模版</a>
		</div>
		<div id="import_excel_user">
			<form id="regIO_fileform_user" method="post" enctype="multipart/form-data">
				<label for="regIO_file_user" class="excel">选择要导入的Excel文件:</label> <br> <br> <input type="file" name="file"
					id="regIO_file_user" size="8" /> <br> <br> <input type="button" value="导入用户数据"
					onclick="$('#regIO_fileform_user').submit(); " />
			</form>
		</div>
		
		<div id="clear"></div>
	</div>
	-->
</body>
</html>